package com.tjh.spring5.testdemo;

import com.tjh.spring5.service.UserService_day33;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * day38：
 *      Spring5 整合 JUnit4
 *      测试：注释 TxConfig 类的 getDataSourceTransactionManager(DataSource dataSource) 方法后执行
 */
@RunWith(SpringJUnit4ClassRunner.class) //单元测试框架
@ContextConfiguration("classpath:beanday31.xml") //加载配置文件
public class JTest4 {

    @Autowired
    private UserService_day33 userService;

    @Test
    public void test1() {
        userService.accountMoney();
    }
}
